

    <div class="content">
        
        <div class="header">
            
            <h1 class="page-title">产品管理</h1>
        </div>
        
                  

        <div class="container-fluid">
            <div class="row-fluid">
                    
<div class="btn-toolbar">
    <a href="javascript:;" onclick="append('新增管理员','{:U(\'Admin/Products/append\')}','800','400')"><button class="btn btn-primary"><i class="icon-plus"></i>新增产品</button></a>
    
  <div class="btn-group">
  </div>
</div>
<div class="well">
    <table class="table">
      <thead>
        <tr>
          <th>#</th>
          <th>产品名称</th>
          <th>产品类别</th>
          <th>创建日期</th>
          <th>产品管理</th>
        </tr>
      </thead>
      <tbody>

        <volist name='list' id='vo'>
        <tr>
          <td>{$vo.pro_id}</td>
          <td>{$vo.pro_name}</td>
          <td>{$vo.catename}</td>
          <td>{$vo.create_time}</td>
          <td>
              <a href="javascript:;" onclick="edit('产品修改','{:U(\'Admin/Products/edit\',array(\'pro_id\'=>$vo[\'pro_id\']))}','{$vo.pro_id}','800','400')"><button class="btn btn-primary"><i class="icon-pencil"></i></button></a>
              <a href="javascript:;"  onclick="del_pro('{:U(\'Admin/Products/del\')}','{$vo.pro_id}')" role="button" data-toggle="modal"><button class="btn btn-primary"><i class="icon-remove"></i></button></a>
          </td>
        </tr>
        </volist>
      
      </tbody>
    </table>
</div>
<div class="pagination">
    
    {$page}
</div>

<script type="text/javascript">
   function append(title,url,w,h){
      layer_show(title,url,w,h);
   }
   function edit(title,url,id,w,h){
      layer_show(title,url,w,h);
   }

   function del_pro(url,pro_id){

      layer.confirm('确定要删除吗',function(index){
        $.ajax({
          type:'POST',
          url: url ,
          dataType:'json',
          data: {pro_id:pro_id},
          success: function(data){
            if(data.code==1){
              layer.msg(data.info,{icon:1,time:1000},function(){
                location.href = "{:U('showlist')}";
              });
              
            }else{
              layer.msg(data.info,{icon:2,time:1000});
              return false;
            }
            
          },
          error:function(data){
            
          }

        })
      });
   }
</script>

                